// import com.alibaba.druid.DbType;
// import com.alibaba.druid.sql.ast.SQLExpr;
// import com.alibaba.druid.sql.ast.SQLObject;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.ast.expr.SQLCharExpr;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "SQLShowMaterializedViewStatement.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../expr/SQLCharExpr.h"

SQLShowMaterializedViewStatement::SQLShowMaterializedViewStatement()
{
}

SQLShowMaterializedViewStatement::SQLShowMaterializedViewStatement(DbType_ptr dbType)
    : SQLStatementImpl(dbType)
{
}

// @Override
void SQLShowMaterializedViewStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLShowMaterializedViewStatement)))
  {
    acceptChild(visitor, name);
    acceptChild(visitor, like);
  }
  visitor->endVisit(SharedObject(SQLShowMaterializedViewStatement));
}

SQLExpr_ptr SQLShowMaterializedViewStatement::getName()
{
  return name;
}

void SQLShowMaterializedViewStatement::setName(SQLExpr_ptr x)
{
  if (x != nullptr)
  {
    x->setParent(SharedObject(SQLShowMaterializedViewStatement));
  }
  this->name = x;
}

SQLExpr_ptr SQLShowMaterializedViewStatement::getLike()
{
  return like;
}

void SQLShowMaterializedViewStatement::setLike(SQLCharExpr_ptr x)
{
  if (x != nullptr)
  {
    x->setParent(SharedObject(SQLShowMaterializedViewStatement));
  }
  this->like = x;
}

// @Override
SQLObject_list_ptr SQLShowMaterializedViewStatement::getChildren()
{
  SQLObject_list_ptr children = std::make_shared<std::list<SQLObject_ptr>>();
  if (name != nullptr)
  {
    children->push_back(name);
    children->push_back(like);
  }
  return children;
}
